<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API AdminRepository Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['prefix' => 'auth'], function () {
    Route::post('logout', 'AuthController@logout');
    Route::post('refresh', 'AuthController@refresh');
    Route::any('me', 'AuthController@me');
    Route::post('change-password','AuthController@changePassword');         //修改密码
});

Route::resource('restful','ApiController');                             //通用resetFul接口
Route::post('destroyBatch','ApiController@destroyBatch');               //批量删除
Route::post('file-upload','ResourceController@upload');                 //文件上传接口
Route::post('state-change','StateController@change');                   //状态切换接口

Route::get('captcha','BaseController@captcha');                         //验证码
Route::get('product/{id}/labels','ProductController@attrGroupLabels');          //验证码

Route::get('order-export','OrderController@export');                                //导出
Route::post('order-delivery','OrderController@delivery');                           //发货

Route::get('chart-visit','ChartController@visitChart');                   //浏览数据
Route::get('chart-order','ChartController@orderChart');                   //订单数据
Route::get('chart-new','ChartController@newChart');                      //新增数据

Route::get('areas','AreaController@index');                      //新增数据

Route::group(['middleware'=>'adminJWT'],function (){
    Route::post('withdraw/change','WithdrawController@change');     //提现审核
    Route::post('withdraw/complete','WithdrawController@complete');     //提现已打款
    Route::post('dealer/change','StateController@dealer');     //经销商设置或取消
});

